package com.hmall.trade.domain.dto;

import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.util.CollectionUtils;

import java.util.List;

@Data
@NoArgsConstructor
public class OrderCheckMsgDto {

    private Long orderId;

    private List<Integer> delayMillis;


    public OrderCheckMsgDto(Long orderId, List<Integer> delayMillis){
        this.orderId = orderId;
        this.delayMillis = delayMillis;
    }

    /**
     * 判断是否还有下一个过期时间
     * */
    public boolean hasNextMill(){
        return !CollectionUtils.isEmpty(delayMillis);
    }

    /**
     * 获取下一个过期时间
     * */
    public Integer getNextMill(){
        return delayMillis.remove(0);
    }

}